package rules;

import stock.Company;

public abstract class Rule {

	private Rule nextRule = null;

	public abstract boolean matches(Company company);
	
	public boolean next(Company company) {
		if ( this.nextRule != null ){
			return this.nextRule.matches(company);
		}
		return true;
	}

	public void setNextRule(Rule rule){
		this.nextRule = rule;
	}
	
	public Rule getNextRule() {
		return nextRule;
	}
	
}
